/*
 * @Descripttion: GGB
 * @version: 1.0
 * @Author: GGB
 * @Date: 2021-08-06 07:08:29
 * @LastEditors: GGB
 * @LastEditTime: 2021-08-24 18:57:13
 */
import 'package:flutter/material.dart';

import 'bottom_hode.dart';
import 'bottom_open.dart';

class BottomNav extends StatelessWidget {
  const BottomNav({Key key, this.height, this.isOpen, this.onTap})
      : super(key: key);
  final double height;
  final VoidCallback onTap;
  final bool isOpen;

  @override
  Widget build(BuildContext context) => Positioned(
      bottom: 0,
      left: 0,
      right: 0,
      child: GestureDetector(
        onTap: onTap,
        child: AnimatedContainer(
          height: height,
          decoration: BoxDecoration(
            color: Colors.white,
            borderRadius: BorderRadius.only(
              topLeft: Radius.circular(24),
              topRight: Radius.circular(24),
            ),
            boxShadow: [
              BoxShadow(
                color: Colors.black.withOpacity(0.1),
                offset: Offset(0, -2),
                blurRadius: 3,
                spreadRadius: 3,
              ),
            ],
          ),
          duration: Duration(milliseconds: 250),
          padding: EdgeInsets.symmetric(horizontal: 16),
          child: isOpen ? BottomOpen() : BottomHide(),
        ),
      ));
}
